//
//  AppController.h
//  WorkBreak
//
//  Created by Wei Nan Li on 11/7/08.
//  Copyright 2008 __MyCompanyName__. All rights reserved.
//

#import <Cocoa/Cocoa.h>
#import <Growl/Growl.h>

#import "WBScreenMasker.h"
#import "WBView.h"
#import "Prefs.h"

@interface AppController : NSObject <GrowlApplicationBridgeDelegate> {	
	IBOutlet NSPanel *prefPanel;
	IBOutlet WBView *mainView;
	IBOutlet NSTextField *alertIntervalField;
	IBOutlet NSTextField *restTimeField;	
	
	NSStatusItem *statusItem;
	BOOL myStatus;

	WBScreenMasker *masker;
	NSSound *onSound;
	NSSound *offSound;

	CGFloat alertInterval;
	CGFloat restTime;
	
	NSTimer *noteCycleTimer;
	NSTimer *restCycleTimer;
	NSTimer *restProgressCycleTimer;
	NSTimer *countdownTimer;
	float counterStartValue;
	float counter;
	NSPoint currPos;
	NSPoint prevPos;
	BOOL isIdle;
	
	NSMenuItem *timerSwitchItem;
	NSMenuItem *preferencesItem;
	NSMenuItem *forceModeItem;
	NSMenuItem *quitItem;
	NSMenuItem *statusMenuItem;
	
	int timerStatus;
	
	IBOutlet Prefs	*prefs;
}

@property(readwrite, assign) CGFloat alertInterval;
@property(readwrite, assign) CGFloat restTime;

- (IBAction)settingChanged:(id)sender;
- (IBAction)cancel:(id)sender;

- (void) showPreferences;
- (void) switchForceMode;
- (void) registerRestCycleTimer:(float) intervalInSecond;
- (void) fireRestCycle;
- (void) fireNoteCycle;
- (void) fireRestProgressCycle;
- (void) countdownTimer;
- (void) cleanupScreen;
- (void) quitMe;

@end
